package xin.altitude.spring.mybatisplus.joinquery.more2more.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xin.altitude.spring.mybatisplus.joinquery.more2more.base.common.AjaxResult;
import xin.altitude.spring.mybatisplus.joinquery.more2more.domain.Student;
import xin.altitude.spring.mybatisplus.joinquery.more2more.service.IStudentService;

@RestController
@RequestMapping("/front/student")
public class StudentProController {
    @Qualifier("studentProServiceImpl")
    @Autowired
    private IStudentService studentService;
    
    //*****增加方法
    @GetMapping("/sasa/{id}")
    public AjaxResult sasa(@PathVariable Integer id) {
        return AjaxResult.success(studentService.getStudent(id));
    }
    
    @GetMapping("/sasa/dd")
    public AjaxResult sasadd() {
        return AjaxResult.success(studentService.getStudentList());
    }
    
    @GetMapping("/sasa/tt")
    public AjaxResult sasatt(Page<Student> page) {
        return AjaxResult.success(studentService.getStudentPage(page));
    }
}
